<cfsilent>
	<cfset request.oEmbed = CreateObject("component","oEmbed") />
</cfsilent>
<html>
	<head>
		<title>Test Embed</title>
	</head>
	<body><cfoutput>
		<cfparam name="form.target_url" default="">
		<fieldset id="embedForm">
			<legend>What would you like to embed</legend>
			<form method="post">
				<label for="target_url">URI:</label>
				<input type="text" name="target_url" id="target_url" value="#form["target_url"]#" size="75" />
				<input type="submit" value="embed" />
			</form>
		</fieldset>

		<cfif IsDefined("form.target_url") and Len(Trim(form.target_url))>
			<fieldset id="embeded">
				<legend>Embedded using oEmbed</legend>
		<div id="embeddingDetail">
			We are going to embed: <strong>#form.target_url#</strong>
		</div>

		<div id="embeddingSource">
			<!-- start: just return the HTML -->
			#request.oEmbed.embedhttp(form["target_url"])#
			<!-- end:   just return the HTML -->
			<br /><br />
			<cfset stEmbed = request.oEmbed.embed(form["target_url"]) />
			<table width="750" border="0" cellpadding="2" cellspacing="0">
				<thead>
					<tr>
						<th colspan="2">The returned structure</th>
					</tr>
				</thead>
				<tbody>
					<tr>
						<td width="#stEmbed.width#" rowspan="#StructCount(stEmbed)#" valign="top">
							#stEmbed.html#
						</td>
						<td><strong>HTML:</strong><br />#HTMLEditFormat(stEmbed.html)#</td>
					</tr>
					<cfloop collection="#stEmbed#" item="e"><cfif e NEQ "html">
					<tr>
						<td><strong>#e#</strong><br />#stEmbed[e]#</td>
					</tr>
					</cfif></cfloop>
				</tbody>
			</table>
		</div>
			</fieldset>
		</cfif>

	</cfoutput></body>
</html>